﻿using Inaction.Criteria;
using Inaction.Security;
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

namespace Inaction.Business.Security
{
    [Serializable]
    public class UserCriteria : Inaction.Criteria.CriteriaBase
    {
        [CriteriaField("DepartmentId", Logic = CriteriaLogic.And, Operate = CriteriaOperate.Equal)]
        private String _departmentId;
        [Display(Description = "所属部门"), DisplayName("所属部门")]
        public String DepartmentId
        {
            get { return _departmentId; }
            set { _departmentId = value; }
        }

        [CriteriaField("UserType", Logic = CriteriaLogic.And, Operate = CriteriaOperate.Equal)]
        UserType? _type;
        [Display(Description = "用户类型"), DisplayName("用户类型")]
        public UserType? Type
        {
            get { return _type; }
            set { _type = value; }
        }

        [CriteriaField("Number", Logic = CriteriaLogic.And, Operate = CriteriaOperate.Equal)]
        string _number;
        [Display(Description = "用户帐号"), DisplayName("用户帐号")]
        public string Number
        {
            get { return _number; }
            set { _number = value; }
        }

        [CriteriaField("Number", Logic = CriteriaLogic.And, Operate = CriteriaOperate.Like)]
        string _numberLike;
        [Display(Description = "用户帐号"), DisplayName("用户帐号")]
        public string NumberLike
        {
            get { return _numberLike; }
            set { _numberLike = value; }
        }

        [CriteriaField("Name", Logic = CriteriaLogic.And, Operate = CriteriaOperate.Like)]
        string nameLike;
        [Display(Description = "用户名"), DisplayName("用户名")]
        public string NameLike
        {
            get { return nameLike; }
            set { nameLike = value; }
        }

        [CriteriaField("Password", Logic = CriteriaLogic.And, Operate = CriteriaOperate.Equal)]
        byte[] _password;
        [Display(Description = "密码"), DisplayName("密码")]
        public byte[] Password
        {
            get { return _password; }
            set { _password = value; }
        }
    }
}
